package com.example.androidlearning.sy6;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.View;
import android.widget.Button;

import com.example.androidlearning.R;

public class Sy6Activity01 extends Activity {

    Button button;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sy0601_bundle);
        button = findViewById(R.id.sy0601_btn);

//        savedInstanceState.putString("persion","这是Sy6Activity01传过来数据");
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putString("text","这是Sy6Activity01传过来数据");
                Intent intent = new Intent(Sy6Activity01.this, Sy6Activity010.class);
                //放入bundle
                intent.putExtras(bundle);
                startActivity(intent);
//                startActivity(new Intent(Sy6Activity01.this, Sy6Activity010.class));

            }
        });

    }
}
